import axios from '@/util/axios';
import { OSS } from '@/util/constant'

const actions = {
    async getPolicy(store: ActionContext<State, any>) {
        try {
            let res = await axios.get(OSS.URL)
            store.commit('setPolicy', res.data)
        } catch (e) {
            console.log(e)
        }
    },

    getStatus(store: any) {
        let { customer_id, enterprise_id } = store.state.userInfo;
        return axios.get(`customerInfoStatus/queryCustomerInfoStatus?customerId1=${customer_id}&enterpriseId=${enterprise_id}`)
            .then((response) => {
                store.commit('setUserStatus', response.data);
            })
    },
    async getAllTips (store: any) {
        let res = await axios.get('orders/order/getPendingOrderCount')
        store.commit('setAllTips', res.data)

    }
}

export default actions
